package com.qianyu.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianyu.project.entity.ProgressPayment;
import com.qianyu.project.mapper.provider.sy.ProgressPaymentProvider;
import com.qianyu.project.vo.ProgressPaymentVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * <p>
 * 进度款申报 Mapper 接口
 * </p>
 *
 * @author gs
 * @since 2021-01-30
 */
@Repository
public interface ProgressPaymentMapper extends BaseMapper<ProgressPayment> {

    @Select("select max(id) from progress_payment where year(apply_date) = year(curdate())")
    String getMaxId();

    @SelectProvider(type = ProgressPaymentProvider.class, method = "getList")
    IPage<ProgressPaymentVo> getList(IPage page, Map<String, String> params);

    @SelectProvider(type = ProgressPaymentProvider.class, method = "getOne")
    ProgressPaymentVo getOne(String id);

    @SelectProvider(type = ProgressPaymentProvider.class, method = "getProgressQuery")
    IPage<ProgressPaymentVo> getProgressQuery(IPage page, Map<String, String> params);
}
